<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=0.8"/><title>4.6&nbsp;局部绑定</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="racket.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><script type="text/javascript" src="manual-racket.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9658;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Racket&#25351;&#21335;</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="intro.html" class="tocviewlink" data-pltdoc="x">&#27426;&#36814;&#26469;&#21040;Racket!</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="to-scheme.html" class="tocviewlink" data-pltdoc="x">Racket&#27010;&#35201;</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="datatypes.html" class="tocviewlink" data-pltdoc="x">&#20869;&#32622;&#30340;&#25968;&#25454;&#31867;&#22411;</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="scheme-forms.html" class="tocviewselflink" data-pltdoc="x">&#34920;&#36798;&#24335;&#21644;&#23450;&#20041;</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="define-struct.html" class="tocviewlink" data-pltdoc="x">&#31243;&#24207;&#21592;&#23450;&#20041;&#30340;&#25968;&#25454;&#31867;&#22411;</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="modules.html" class="tocviewlink" data-pltdoc="x">&#27169;&#22359;</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">&#21512;&#32422;</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="i_o.html" class="tocviewlink" data-pltdoc="x">&#36755;&#20837;&#21644;&#36755;&#20986;</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="regexp.html" class="tocviewlink" data-pltdoc="x">&#27491;&#21017;&#34920;&#36798;&#24335;</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">&#24322;&#24120;&#19982;&#25511;&#21046;</a></td></tr><tr><td align="right">11&nbsp;</td><td><a href="for.html" class="tocviewlink" data-pltdoc="x">&#36845;&#20195;&#21644;&#25512;&#23548;</a></td></tr><tr><td align="right">12&nbsp;</td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">&#27169;&#24335;&#21305;&#37197;</a></td></tr><tr><td align="right">13&nbsp;</td><td><a href="classes.html" class="tocviewlink" data-pltdoc="x">&#31867;&#21644;&#23545;&#35937;</a></td></tr><tr><td align="right">14&nbsp;</td><td><a href="units.html" class="tocviewlink" data-pltdoc="x">&#21333;&#20803;</a></td></tr><tr><td align="right">15&nbsp;</td><td><a href="reflection.html" class="tocviewlink" data-pltdoc="x">&#21453;&#23556;&#21644;&#21160;&#24577;&#27714;&#20540;</a></td></tr><tr><td align="right">16&nbsp;</td><td><a href="macros.html" class="tocviewlink" data-pltdoc="x">&#23439;</a></td></tr><tr><td align="right">17&nbsp;</td><td><a href="languages.html" class="tocviewlink" data-pltdoc="x">&#21019;&#36896;&#35821;&#35328;</a></td></tr><tr><td align="right">18&nbsp;</td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">&#24182;&#21457;&#19982;&#21516;&#27493;</a></td></tr><tr><td align="right">19&nbsp;</td><td><a href="performance.html" class="tocviewlink" data-pltdoc="x">&#24615;&#33021;</a></td></tr><tr><td align="right">20&nbsp;</td><td><a href="parallelism.html" class="tocviewlink" data-pltdoc="x">&#24182;&#34892;</a></td></tr><tr><td align="right">21&nbsp;</td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">&#36816;&#34892;&#21644;&#21019;&#24314;&#21487;&#25191;&#34892;&#31243;&#24207;</a></td></tr><tr><td align="right">22&nbsp;</td><td><a href="More_Libraries.html" class="tocviewlink" data-pltdoc="x">&#26356;&#22810;&#30340;&#24211;</a></td></tr><tr><td align="right">23&nbsp;</td><td><a href="dialects.html" class="tocviewlink" data-pltdoc="x">Racket&#21644;Scheme&#30340;&#26041;&#35328;</a></td></tr><tr><td align="right">24&nbsp;</td><td><a href="other-editors.html" class="tocviewlink" data-pltdoc="x">&#21629;&#20196;&#34892;&#24037;&#20855;&#21644;&#20320;&#30340;&#32534;&#36753;&#22120;&#36873;&#25321;</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_1&quot;);">&#9660;</a></td><td>4&nbsp;</td><td><a href="scheme-forms.html" class="tocviewlink" data-pltdoc="x">&#34920;&#36798;&#24335;&#21644;&#23450;&#20041;</a></td></tr></table><div class="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">4.1&nbsp;</td><td><a href="syntax-notation.html" class="tocviewlink" data-pltdoc="x">&#26631;&#35760;&#27861;</a></td></tr><tr><td align="right">4.2&nbsp;</td><td><a href="binding.html" class="tocviewlink" data-pltdoc="x">&#26631;&#35782;&#31526;&#21644;&#32465;&#23450;</a></td></tr><tr><td align="right">4.3&nbsp;</td><td><a href="application.html" class="tocviewlink" data-pltdoc="x">&#20989;&#25968;&#35843;&#29992;</a></td></tr><tr><td align="right">4.4&nbsp;</td><td><a href="lambda.html" class="tocviewlink" data-pltdoc="x">lambda&#20989;&#25968;&#65288;&#36807;&#31243;&#65289;</a></td></tr><tr><td align="right">4.5&nbsp;</td><td><a href="define.html" class="tocviewlink" data-pltdoc="x">&#23450;&#20041;&#65306;<span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span></a></td></tr><tr><td align="right">4.6&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">&#23616;&#37096;&#32465;&#23450;</a></td></tr><tr><td align="right">4.7&nbsp;</td><td><a href="conditionals.html" class="tocviewlink" data-pltdoc="x">&#26465;&#20214;</a></td></tr><tr><td align="right">4.8&nbsp;</td><td><a href="begin.html" class="tocviewlink" data-pltdoc="x">&#23450;&#24207;</a></td></tr><tr><td align="right">4.9&nbsp;</td><td><a href="set_.html" class="tocviewlink" data-pltdoc="x">&#36171;&#20540;&#65306;<span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span></a></td></tr><tr><td align="right">4.10&nbsp;</td><td><a href="quote.html" class="tocviewlink" data-pltdoc="x">&#24341;&#29992;&#65306;<span class="RktSym"><span class="badlink"><span class="RktValLink">quote</span></span></span>&#21644;<span class="RktVal">'</span></a></td></tr><tr><td align="right">4.11&nbsp;</td><td><a href="qq.html" class="tocviewlink" data-pltdoc="x">&#20934;&#24341;&#29992;&#65306;<span class="RktSym"><span class="badlink"><span class="RktValLink">quasiquote</span></span></span>&#21644;<span class="RktVal">&lsquo;</span></a></td></tr><tr><td align="right">4.12&nbsp;</td><td><a href="case.html" class="tocviewlink" data-pltdoc="x">&#31616;&#21333;&#20998;&#27966;&#65306;<span class="RktSym"><span class="badlink"><span class="RktValLink">case</span></span></span></a></td></tr><tr><td align="right">4.13&nbsp;</td><td><a href="parameterize.html" class="tocviewlink" data-pltdoc="x">&#21160;&#24577;&#32465;&#23450;&#65306;<span class="RktSym"><span class="badlink"><span class="RktValLink">parameterize</span></span></span></a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_2&quot;);">&#9658;</a></td><td>4.6&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">&#23616;&#37096;&#32465;&#23450;</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">4.6.1&nbsp;</td><td><a href="#%28part._parallel-binding-let%29" class="tocviewlink" data-pltdoc="x">&#24182;&#34892;&#32465;&#23450;&#65306;let</a></td></tr><tr><td align="right">4.6.2&nbsp;</td><td><a href="#%28part._.Sequential-.Binding-let~5d%29" class="tocviewlink" data-pltdoc="x">&#39034;&#24207;&#32465;&#23450;&#65306;let*</a></td></tr><tr><td align="right">4.6.3&nbsp;</td><td><a href="#%28part._.Recursive-.Binding-letrec%29" class="tocviewlink" data-pltdoc="x">&#36882;&#24402;&#32465;&#23450;&#65306;letrec</a></td></tr><tr><td align="right">4.6.4&nbsp;</td><td><a href="#%28part._.Named-let%29" class="tocviewlink" data-pltdoc="x">&#21629;&#21517;let</a></td></tr><tr><td align="right">4.6.5&nbsp;</td><td><a href="#%28part._.Multiple-.Values-let%29" class="tocviewlink" data-pltdoc="x">多值绑定：let-<wbr></wbr>values，let*-<wbr></wbr>values，letrec-<wbr></wbr>values</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">4.6.1<tt>&nbsp;</tt></span><a href="#%28part._parallel-binding-let%29" class="tocsubseclink" data-pltdoc="x">&#24182;&#34892;&#32465;&#23450;&#65306;let</a></td></tr><tr><td><span class="tocsublinknumber">4.6.2<tt>&nbsp;</tt></span><a href="#%28part._.Sequential-.Binding-let~5d%29" class="tocsubseclink" data-pltdoc="x">&#39034;&#24207;&#32465;&#23450;&#65306;let*</a></td></tr><tr><td><span class="tocsublinknumber">4.6.3<tt>&nbsp;</tt></span><a href="#%28part._.Recursive-.Binding-letrec%29" class="tocsubseclink" data-pltdoc="x">&#36882;&#24402;&#32465;&#23450;&#65306;letrec</a></td></tr><tr><td><span class="tocsublinknumber">4.6.4<tt>&nbsp;</tt></span><a href="#%28part._.Named-let%29" class="tocsubseclink" data-pltdoc="x">&#21629;&#21517;let</a></td></tr><tr><td><span class="tocsublinknumber">4.6.5<tt>&nbsp;</tt></span><a href="#%28part._.Multiple-.Values-let%29" class="tocsubseclink" data-pltdoc="x">多值绑定：let-<wbr></wbr>values，let*-<wbr></wbr>values，letrec-<wbr></wbr>values</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><div class="nosearchform"></div>&nbsp;&nbsp;</span><span class="navright">&nbsp;&nbsp;<a href="define.html" title="backward to &quot;4.5 定义：define&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="scheme-forms.html" title="up to &quot;4 表达式和定义&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="conditionals.html" title="forward to &quot;4.7 条件&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h4>4.6<tt>&nbsp;</tt><a name="(part._let)"></a>&#23616;&#37096;&#32465;&#23450;</h4><p>&#34429;&#28982;&#20869;&#37096;<span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span>&#21487;&#29992;&#20110;&#23616;&#37096;&#32465;&#23450;&#65292;Racket&#25552;&#20379;&#20102;&#19977;&#31181;&#34920;&#65292;&#23427;&#20204;&#32473;&#20104;&#31243;&#24207;&#21592;&#22312;&#32465;&#23450;&#26041;&#38754;&#30340;&#26356;&#22810;&#25511;&#21046;&#65306;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#12289;<span class="RktSym"><span class="badlink"><span class="RktValLink">let*</span></span></span>&#21644;<span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span>&#12290;</p><h5>4.6.1<tt>&nbsp;</tt><a name="(part._parallel-binding-let)"></a>&#24182;&#34892;&#32465;&#23450;&#65306;let</h5><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>&#22312;&#12298;Racket&#21442;&#32771;&#12299;&#30340;&#8220;&#65288;let&#65289;&#8221;&#37096;&#20998;&#20063;&#26377;&#20851;&#20110;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#30340;&#25991;&#26723;&#12290;</p></blockquote></blockquote></blockquote><p>&#19968;&#20010;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#34920;&#32465;&#23450;&#19968;&#32452;&#26631;&#35782;&#31526;&#65292;&#27599;&#20010;&#23545;&#24212;&#26576;&#20010;&#34920;&#36798;&#24335;&#30340;&#32467;&#26524;&#65292;&#20197;&#22312;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#20027;&#20307;&#20013;&#20351;&#29992;&#65306;</p><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">body</span><span class="hspace">&nbsp;</span><span class="RktMeta">...+</span><span class="RktPn">)</span></td></tr></table></blockquote></blockquote><p><span class="RktVar">id</span>&#32465;&#23450;&#8221;&#22312;&#24182;&#34892;&#65288;parallel&#65289;&#29366;&#24577;&#20013;&#8221;&#12290;&#20063;&#23601;&#26159;&#35828;&#65292;&#22312;&#21491;&#25163;&#36793;&#30340;<span class="RktVar">expr</span>&#37324;&#38754;&#27809;&#26377;<span class="RktVar">id</span>&#34987;&#32465;&#23450;&#20110;&#20219;&#20309;<span class="RktVar">id</span>&#65292;&#20294;&#22312;<span class="RktVar">body</span>&#20013;&#25152;&#26377;&#30340;&#37117;&#33021;&#25214;&#21040;&#12290;<span class="RktVar">id</span>&#24517;&#39035;&#19981;&#21516;&#20110;&#20854;&#23427;&#24444;&#27492;&#12290;</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">me</span><span class="hspace">&nbsp;</span><span class="RktVal">"Bob"</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">me</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">"Bob"</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">me</span><span class="hspace">&nbsp;</span><span class="RktVal">"Bob"</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">myself</span><span class="hspace">&nbsp;</span><span class="RktVal">"Robert"</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">I</span><span class="hspace">&nbsp;</span><span class="RktVal">"Bobby"</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">me</span><span class="hspace">&nbsp;</span><span class="RktSym">myself</span><span class="hspace">&nbsp;</span><span class="RktSym">I</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'("Bob" "Robert" "Bobby")</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">me</span><span class="hspace">&nbsp;</span><span class="RktVal">"Bob"</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">me</span><span class="hspace">&nbsp;</span><span class="RktVal">"Robert"</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">me</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">eval:3:0: let: duplicate identifier</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">at: me</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">in: (let ((me "Bob") (me "Robert")) me)</span></p></td></tr></table></blockquote></div></p><p>&#20107;&#23454;&#19978;&#19968;&#20010;<span class="RktVar">id</span>&#30340;<span class="RktVar">expr</span>&#19981;&#30693;&#36947;&#23427;&#33258;&#24049;&#30340;&#32465;&#23450;&#36890;&#24120;&#23545;&#23553;&#35013;&#22120;&#26377;&#29992;&#65292;&#23553;&#35013;&#22120;&#24517;&#39035;&#20256;&#22238;&#26087;&#30340;&#20540;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym"><span class="badlink"><span class="RktValLink">+</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">string?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">string-append</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">+</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">&#20351;&#29992;&#21407;&#26469;&#30340; </span><span class="RktSym"><span class="badlink"><span class="RktValLink">+</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">+</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">+</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"see"</span><span class="hspace">&nbsp;</span><span class="RktVal">"saw"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'(3 "seesaw")</span></p></td></tr></table></blockquote><p>&#20598;&#23572;&#65292;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#32465;&#23450;&#30340;&#24182;&#34892;&#24615;&#20415;&#20110;&#20132;&#25442;&#25110;&#37325;&#25490;&#19968;&#32452;&#32465;&#23450;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">me</span><span class="hspace">&nbsp;</span><span class="RktVal">"Tarzan"</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">you</span><span class="hspace">&nbsp;</span><span class="RktVal">"Jane"</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">me</span><span class="hspace">&nbsp;</span><span class="RktSym">you</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">you</span><span class="hspace">&nbsp;</span><span class="RktSym">me</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">me</span><span class="hspace">&nbsp;</span><span class="RktSym">you</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'("Jane" "Tarzan")</span></p></td></tr></table></blockquote><p><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#32465;&#23450;&#20197;&#8220;&#24182;&#34892;&#8221;&#30340;&#29305;&#24615;&#24182;&#19981;&#24847;&#21619;&#30528;&#38544;&#21547;&#21516;&#26102;&#21457;&#29983;&#27714;&#20540;&#12290;&#23613;&#31649;&#32465;&#23450;&#34987;&#24310;&#36831;&#21040;&#25152;&#26377;<span class="RktVar">expr</span>&#34987;&#27714;&#20540;&#65292;<span class="RktVar">expr</span>&#26159;&#25353;&#39034;&#24207;&#27714;&#20540;&#30340;&#12290;</p><h5>4.6.2<tt>&nbsp;</tt><a name="(part._.Sequential-.Binding-let~5d)"></a>&#39034;&#24207;&#32465;&#23450;&#65306;let*</h5><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>&#22312;&#12298;Racket&#21442;&#32771;&#12299;&#30340;&#8220;&#65288;let&#65289;&#8221;&#37096;&#20998;&#20063;&#26377;&#20851;&#20110;<span class="RktSym"><span class="badlink"><span class="RktValLink">let*</span></span></span>&#30340;&#25991;&#26723;&#12290;</p></blockquote></blockquote></blockquote><p><span class="RktSym"><span class="badlink"><span class="RktValLink">let*</span></span></span>&#30340;&#35821;&#27861;&#21644;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#30340;&#19968;&#26679;&#65306;</p><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let*</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">body</span><span class="hspace">&nbsp;</span><span class="RktMeta">...+</span><span class="RktPn">)</span></td></tr></table></blockquote></blockquote><p>&#19981;&#21516;&#30340;&#26159;&#65292;&#27599;&#20010;<span class="RktVar">id</span>&#21487;&#22312;&#20197;&#21518;&#30340;<span class="RktVar">expr</span>&#20351;&#29992;&#20013;&#20197;&#21450;<span class="RktVar">body</span>&#20013;&#25214;&#21040;&#12290;&#27492;&#22806;&#65292;<span class="RktVar">id</span>&#19981;&#38656;&#35201;&#26377;&#21306;&#21035;&#65292;&#24182;&#19988;&#26368;&#36817;&#30340;&#32465;&#23450;&#26159;&#21487;&#35265;&#30340;&#19968;&#20010;&#12290;</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let*</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"Burroughs"</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"Rice"</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">z</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"Edgar"</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">z</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'(("Burroughs") ("Rice" "Burroughs") ("Edgar" "Rice" "Burroughs"))</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let*</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"Burroughs"</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"Rice"</span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"Edgar"</span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">name</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'("Edgar" "Rice" "Burroughs")</span></p></td></tr></table></blockquote></div></p><p>&#25442;&#35328;&#20043;&#65292;&#19968;&#20010;<span class="RktSym"><span class="badlink"><span class="RktValLink">let*</span></span></span>&#34920;&#31561;&#25928;&#20110;&#23884;&#22871;&#30340;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#34920;&#65292;&#27599;&#19968;&#20010;&#24102;&#26377;&#19968;&#20010;&#21333;&#29420;&#30340;&#32465;&#23450;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"Burroughs"</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"Rice"</span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"Edgar"</span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">name</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'("Edgar" "Rice" "Burroughs")</span></p></td></tr></table></blockquote><h5>4.6.3<tt>&nbsp;</tt><a name="(part._.Recursive-.Binding-letrec)"></a>&#36882;&#24402;&#32465;&#23450;&#65306;letrec</h5><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>&#22312;&#12298;Racket&#21442;&#32771;&#12299;&#30340;&#8220;&#65288;let&#65289;&#8221;&#37096;&#20998;&#20063;&#26377;&#20851;&#20110;<span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span>&#30340;&#25991;&#26723;&#12290;</p></blockquote></blockquote></blockquote><p><span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span>&#30340;&#35821;&#27861;&#20063;&#21644;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#30456;&#21516;&#65306;</p><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">body</span><span class="hspace">&nbsp;</span><span class="RktMeta">...+</span><span class="RktPn">)</span></td></tr></table></blockquote></blockquote><p>&#32780;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#20351;&#20854;&#32465;&#23450;&#20165;&#22312;<span class="RktVar">body</span>&#20869;&#34987;&#25214;&#21040;&#65292;<span class="RktSym"><span class="badlink"><span class="RktValLink">let*</span></span></span>&#20351;&#20854;&#32465;&#23450;&#22312;&#20219;&#20309;&#21518;&#38754;&#30340;&#32465;&#23450;<span class="RktVar">expr</span>&#20869;&#34987;&#25214;&#21040;&#65292;<span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span>&#20351;&#20854;&#32465;&#23450;&#22312;&#25152;&#26377;&#20854;&#23427;<span class="RktVar">expr</span>&#8212;&#8212;&#29978;&#33267;&#26356;&#26089;&#30340;<span class="RktVar">expr</span>&#20869;&#34987;&#25214;&#21040;&#12290;&#25442;&#21477;&#35805;&#35828;&#65292;<span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span>&#32465;&#23450;&#26159;&#36882;&#24402;&#30340;&#12290;</p><p>&#22312;&#19968;&#20010;<span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span>&#34920;&#20013;&#30340;<span class="RktVar">expr</span>&#32463;&#24120;&#22823;&#37117;&#26159;&#29992;&#20110;&#36882;&#24402;&#30340;&#20197;&#21450;&#20114;&#30456;&#36882;&#24402;&#30340;<span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span>&#34920;&#20989;&#25968;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">swing</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">t</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">eq?</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">car</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">t</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">tarzan</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">vine</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">tarzan</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cddr</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">t</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">car</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">t</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">swing</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cdr</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">t</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">swing</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">vine</span><span class="hspace">&nbsp;</span><span class="RktVal">tarzan</span><span class="hspace">&nbsp;</span><span class="RktVal">vine</span><span class="hspace">&nbsp;</span><span class="RktVal">vine</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'(vine vine tarzan vine)</span></p></td></tr></table></blockquote><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">tarzan-near-top-of-tree?</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktSym">path</span><span class="hspace">&nbsp;</span><span class="RktSym">depth</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">or</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">equal?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktVal">"tarzan"</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">and</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">directory-exists?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">path</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">tarzan-in-directory?</span><span class="hspace">&nbsp;</span><span class="RktSym">path</span><span class="hspace">&nbsp;</span><span class="RktSym">depth</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">tarzan-in-directory?</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">dir</span><span class="hspace">&nbsp;</span><span class="RktSym">depth</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cond</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">zero?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">depth</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><span class="badlink"><span class="RktValLink">else</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">ormap</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">elem</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">tarzan-near-top-of-tree?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">path-element-&gt;string</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">elem</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">build-path</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">dir</span><span class="hspace">&nbsp;</span><span class="RktSym">elem</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">-</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">depth</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">directory-list</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">dir</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">tarzan-near-top-of-tree?</span><span class="hspace">&nbsp;</span><span class="RktVal">"tmp"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">find-system-path</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">temp-dir</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">4</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">directory-list: could not open directory</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">path: /var/tmp/systemd-private-b892125a75644e58b6ecdc72a95</span></p></td></tr><tr><td><p><span class="RktErr">bbc87-ModemManager.service-nhfBoV</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">system error: Permission denied; errno=13</span></p></td></tr></table></blockquote><p>&#24403;&#19968;&#20010;<span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span>&#34920;&#30340;<span class="RktVar">expr</span>&#26159;&#20856;&#22411;&#30340;<span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span>&#34920;&#36798;&#24335;&#26102;&#65292;&#23427;&#20204;&#21487;&#20197;&#26159;&#20219;&#20309;&#34920;&#36798;&#24335;&#12290;&#34920;&#36798;&#24335;&#25353;&#39034;&#24207;&#27714;&#20540;&#65292;&#32780;&#19988;&#22312;&#27599;&#20010;&#20540;&#34987;&#33719;&#21462;&#21518;&#65292;&#23427;&#31435;&#21363;&#29992;&#30456;&#24212;&#30340;<span class="RktVar">id</span>&#20851;&#32852;&#12290;&#22914;&#26524;&#19968;&#20010;<span class="RktVar">id</span>&#22312;&#20854;&#20540;&#20934;&#22791;&#23601;&#32490;&#20043;&#21069;&#34987;&#24341;&#29992;&#65292;&#19968;&#20010;&#38169;&#35823;&#34987;&#24341;&#21457;&#65292;&#27491;&#22914;&#20869;&#37096;&#23450;&#20041;&#19968;&#26679;&#12290;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">quicksand</span><span class="hspace">&nbsp;</span><span class="RktSym">quicksand</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">quicksand</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">quicksand: undefined;</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr">cannot use before initialization</span></p></td></tr></table></blockquote><h5>4.6.4<tt>&nbsp;</tt><a name="(part._.Named-let)"></a>&#21629;&#21517;let</h5><p>&#19968;&#20010;&#21629;&#21517;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#26159;&#19968;&#20010;&#36845;&#20195;&#21644;&#36882;&#24402;&#34920;&#12290;&#23427;&#20351;&#29992;&#19982;&#23616;&#37096;&#32465;&#23450;&#30456;&#21516;&#30340;&#35821;&#27861;&#20851;&#38190;&#23383;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#65292;&#20294;&#22312;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#20043;&#21518;&#30340;&#19968;&#20010;&#26631;&#35782;&#31526;&#65288;&#32780;&#19981;&#26159;&#19968;&#20010;&#26368;&#36817;&#30340;&#24320;&#25324;&#21495;&#65289;&#35302;&#21457;&#19968;&#20010;&#19981;&#21516;&#30340;&#35299;&#26512;&#12290;</p><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktVar">proc-id</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">arg-id</span><span class="hspace">&nbsp;</span><span class="RktVar">init-expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">body</span><span class="hspace">&nbsp;</span><span class="RktMeta">...+</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></blockquote><p>&#19968;&#20010;&#21629;&#21517;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#34920;&#31561;&#25928;&#20110;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">letrec</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">proc-id</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">arg-id</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">...</span></span></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVar">body</span><span class="hspace">&nbsp;</span><span class="RktSym">...+</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktVar">proc-id</span><span class="hspace">&nbsp;</span><span class="RktVar">init-expr</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">...</span></span></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>&#20063;&#23601;&#26159;&#35828;&#65292;&#19968;&#20010;&#21629;&#21517;<span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span>&#32465;&#23450;&#19968;&#20010;&#21482;&#22312;&#20989;&#25968;&#20027;&#20307;&#20013;&#21487;&#35265;&#30340;&#20989;&#25968;&#26631;&#35782;&#31526;&#65292;&#24182;&#19988;&#29992;&#19968;&#20123;&#21021;&#22987;&#34920;&#36798;&#24335;&#30340;&#20540;&#38544;&#24335;&#35843;&#29992;&#20989;&#25968;&#12290;</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">duplicate</span><span class="hspace">&nbsp;</span><span class="RktSym">pos</span><span class="hspace">&nbsp;</span><span class="RktSym">lst</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">dup</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">i</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">lst</span><span class="hspace">&nbsp;</span><span class="RktSym">lst</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cond</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">=</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">i</span><span class="hspace">&nbsp;</span><span class="RktSym">pos</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">car</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">lst</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">lst</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><span class="badlink"><span class="RktValLink">else</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cons</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">car</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">lst</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">dup</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">+</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">i</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cdr</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">lst</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td> </td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">duplicate</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"apple"</span><span class="hspace">&nbsp;</span><span class="RktVal">"cheese burger!"</span><span class="hspace">&nbsp;</span><span class="RktVal">"banana"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("apple" "cheese burger!" "cheese burger!" "banana")</span></p></td></tr></table></blockquote></div></p><h5>4.6.5<tt>&nbsp;</tt><a name="(part._.Multiple-.Values-let)"></a>&#22810;&#20540;&#32465;&#23450;&#65306;let-values&#65292;let*-values&#65292;letrec-values</h5><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>&#22312;&#12298;Racket&#21442;&#32771;&#12299;&#30340;&#8220;&#65288;let&#65289;&#8221;&#37096;&#20998;&#20063;&#26377;&#20851;&#20110;&#22810;&#20540;&#32465;&#23450;&#34920;&#30340;&#25991;&#26723;&#12290;</p></blockquote></blockquote></blockquote><p>&#20197;<span class="RktSym"><span class="badlink"><span class="RktValLink">define-values</span></span></span>&#21516;&#26679;&#30340;&#26041;&#24335;&#32465;&#23450;&#22312;&#19968;&#20010;&#23450;&#20041;&#20013;&#30340;&#22810;&#20010;&#32467;&#26524;&#65288;&#35265;&#12298;<a href="define.html#%28part._multiple-values%29" data-pltdoc="x">&#22810;&#20540;&#21644;define-values</a>&#12299;&#65289;&#65292;<span class="RktSym"><span class="badlink"><span class="RktValLink">let-values</span></span></span>&#12289;<span class="RktSym"><span class="badlink"><span class="RktValLink">let*-values</span></span></span>&#21644;<span class="RktSym"><span class="badlink"><span class="RktValLink">letrec-values</span></span></span>&#20540;&#32465;&#23450;&#22810;&#20010;&#23616;&#37096;&#32467;&#26524;&#12290;</p><p><div class="SIntrapara"><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let-values</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">body</span><span class="hspace">&nbsp;</span><span class="RktMeta">...+</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></blockquote></div><div class="SIntrapara"><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let*-values</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">body</span><span class="hspace">&nbsp;</span><span class="RktMeta">...+</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></blockquote></div><div class="SIntrapara"><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">letrec-values</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">body</span><span class="hspace">&nbsp;</span><span class="RktMeta">...+</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></blockquote></div></p><p>&#27599;&#20010;<span class="RktVar">expr</span>&#24517;&#39035;&#20135;&#29983;&#19968;&#26679;&#22810;&#30340;&#23545;&#24212;&#20110;<span class="RktVar">id</span>&#30340;&#20540;&#12290;&#32465;&#23450;&#30340;&#35268;&#21017;&#26159;&#21644;&#27809;&#26377;<span class="RktKw">-values</span>&#34920;&#30340;&#34920;&#30456;&#21516;&#65306;<span class="RktSym"><span class="badlink"><span class="RktValLink">let-values</span></span></span>&#30340;<span class="RktVar">id</span>&#21482;&#32465;&#23450;&#22312;<span class="RktVar">body</span>&#37324;&#65292;<span class="RktSym"><span class="badlink"><span class="RktValLink">let*-values</span></span></span>&#30340;<span class="RktVar">id</span>&#32465;&#23450;&#22312;&#21518;&#38754;&#20174;&#21477;&#37324;&#30340;<span class="RktVar">expr</span>&#37324;&#65292;<span class="RktSym">letrec-value</span>&#30340;<span class="RktVar">id</span>&#34987;&#32465;&#23450;&#32473;&#25152;&#26377;&#30340;<span class="RktVar">expr</span>&#12290;</p><p><div class="SIntrapara">Example:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let-values</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">q</span><span class="hspace">&nbsp;</span><span class="RktSym">r</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">quotient/remainder</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">14</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">q</span><span class="hspace">&nbsp;</span><span class="RktSym">r</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'(4 2)</span></p></td></tr></table></blockquote></div></p><div class="navsetbottom"><span class="navleft"><div class="nosearchform"></div>&nbsp;&nbsp;</span><span class="navright">&nbsp;&nbsp;<a href="define.html" title="backward to &quot;4.5 定义：define&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="scheme-forms.html" title="up to &quot;4 表达式和定义&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="conditionals.html" title="forward to &quot;4.7 条件&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>